package com.wowangz.cms.dailyoperation.chargemanagenew.service;

import java.util.HashMap;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.wowangz.cms.dailyoperation.chargemanagenew.pojo.Charge;
import com.wowangz.cms.syscore.exception.ServiceException;
import com.wowangz.cms.syscore.service.BaseService;

public class ChargeService extends BaseService {

	@SuppressWarnings("unused")
	private Logger logger = LoggerFactory.getLogger(ChargeService.class);
	
	/**
	 * 分页查询总条数
	 * 
	 * @param map
	 * @return
	 */
	public long findResultCount(HashMap<String, Object> map) throws ServiceException {
		Long countNum = this.getSqlSession().selectOne("charge.queryChargeCount", map);
		return countNum;
	}

	/**
	 * 查询记录集合
	 * 
	 * @param map
	 * @return
	 */
	public List<Charge> findResultList(HashMap<String, Object> map) throws ServiceException {
		List<Charge> list = this.getSqlSession().selectList("charge.queryChargePage", map);
		return list;
	}
	
	/**
	 * 修改收费管理
	 * @param charge
	 * @throws ServiceException
	 */
	public void updatechargemanageByMap(HashMap<String,Object> hashMap) throws ServiceException{
		this.getSqlSession().update("charge.updatechargemanageByMap", hashMap);
	}
	
	/**
	 * 删除收费管理
	 * @param hashMap
	 * @throws ServiceException
	 */
	public void deleteCharge(HashMap<String,Object> hashMap) throws ServiceException {
		this.getSqlSession().delete("charge.deleteCharge", hashMap);
	}
	/**
	 * 删除收费管理
	 * @param hashMap
	 * @throws ServiceException
	 */
	public void deleteChargeTemp(HashMap<String,Object> hashMap) throws ServiceException {
		this.getSqlSession().delete("charge.deleteChargeTemp", hashMap);
	}
	
	/**
	 * 通过ID查询收费数据
	 * @param hashMap
	 * @return
	 * @throws ServiceException
	 */
	public Charge queryChargeByID(HashMap<String,Object> hashMap) throws ServiceException{
		Charge charge = (Charge)this.getSqlSession().selectOne("charge.queryChargeByID",hashMap);
		return charge;
	}
	
	/**
	 * 新增收费
	 * @param charge
	 * @throws ServiceException
	 */
	public void insertchargemanage(Charge charge) throws ServiceException{
		this.getSqlSession().insert("charge.insertchargemanage",charge);
	}
	
	/**
	 * 修改收费管理临时表
	 * @param charge
	 * @throws ServiceException
	 */
	public void updatechargemanageTempByMap(HashMap<String,Object> hashMap) throws ServiceException{
		this.getSqlSession().update("charge.updatechargemanageTempByMap", hashMap);
	}
	
	
	/**
	 * 通过ID查询收费数据
	 * @param hashMap
	 * @return
	 * @throws ServiceException
	 */
	public Charge queryChargeCheckByID(HashMap<String,Object> hashMap) throws ServiceException{
		Charge charge = (Charge)this.getSqlSession().selectOne("charge.queryChargeCheckByID",hashMap);
		return charge;
	}
	
	/**
	 * 新增收费临时表
	 * @param charge
	 * @throws ServiceException
	 */
	public void insertchargemanageTemp(Charge charge) throws ServiceException{
		this.getSqlSession().insert("charge.insertchargemanageTemp",charge);
	}
}
